package com.asw.springboot.common.listener;

import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;

/**
 * Created by hxq on 2017/5/18.
 */
public class MyApplicationEnvironmentPreparedListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent>{
    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
        System.out.println("在上下文被创建之前，应用环境被已知的上下文环境中使用时被发送");
        String dbUrl = event.getEnvironment().getProperty("asw.db.dbUrl");
        System.out.println(",,,,,,,,,,,"+dbUrl);
    }
}
